//
//  WoHeaderCell.m
//  ZhiBoYuan
//
//  Created by apple on 2018/4/16.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "WoHeaderCell.h"

@implementation WoHeaderCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initUI];
    }
    return self;
}

-(void)initUI{
    

    
    _imageHead = [UIImageView new];
//    _imageHead.image = [UIImage imageNamed:@"图层18"];
//    _imageHead.backgroundColor = [UIColor redColor];
    
    [self.contentView addSubview:_imageHead];
    
    _imageHead.sd_layout
    .leftSpaceToView(self.contentView, 15)
    .centerYEqualToView(self.contentView)
    .widthIs(70)
    .heightIs(70);
    _imageHead.layer.masksToBounds = YES;
    _imageHead.layer.cornerRadius = 35;
    
    
    _nmaLlabel = [UILabel new];
    _nmaLlabel.text = @"小明";
    _nmaLlabel.textColor = [UIColor blackColor];
    
    [self.contentView addSubview:_nmaLlabel];
    
    _nmaLlabel.sd_layout
    .topSpaceToView(self.contentView, SNRealValue(30))
    .leftSpaceToView(_imageHead, 10)
    .widthIs(150)
    .heightIs(20)
    .autoHeightRatio(0);
    
    
    
    _labelA = [UILabel new];
    
    _labelA.text = @"我的学豆:";
    _labelA.textColor = hui8Color;
    _labelA.font = [UIFont systemFontOfSize:14 * KscreenWidth];
    
    
    [self.contentView addSubview:_labelA];
    
    _labelA.sd_layout
    .topSpaceToView(_nmaLlabel, SNRealValue(-10))
    .leftSpaceToView(_imageHead, 10)
    .widthIs(SNRealValue(65));
//    .autoWidthRatio(60);
    
    
    
    _labelB = [UILabel new];
    _labelB.text = @"300";
    _labelB.textColor = [UIColor redColor];
    _labelB.textAlignment = NSTextAlignmentLeft;
    _labelB.font = [UIFont systemFontOfSize:14];
    
    [self.contentView addSubview:_labelB];
    
    _labelB.sd_layout
    .topSpaceToView(_nmaLlabel, SNRealValue(-10))
    .leftSpaceToView(_labelA, 0)
    .widthIs(90 * KscreenWidth);
    
    
    _chonZhiButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    
    [_chonZhiButton setTitle:@"充值" forState:(UIControlStateNormal)];
    
    _chonZhiButton.titleLabel.font = [UIFont systemFontOfSize:14];
    
    [_chonZhiButton setBackgroundColor:[UIColor redColor]];
    _chonZhiButton.layer.masksToBounds = YES;
    _chonZhiButton.layer.cornerRadius = 3;
    [self.contentView addSubview:_chonZhiButton];
    
    
    _chonZhiButton.sd_layout
    .rightSpaceToView(self.contentView, 20)
    .centerYEqualToView(self.contentView)
    .widthIs(50)
    .heightIs(30);

    
    
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
